<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class DropAndCreateFavorites extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('favorites');
        Schema::create('favorites', function (Blueprint $table) {
            $table->increments('id');
            // 媒资ID
            $table->integer('vasseti_id')->index()->nullable();
            // 唯一标识ID
            $table->integer('term_id')->index()->nullable;
            // 收藏时间
            $table->timestamp('add_time')->nullable();
            $table->timestamps();
            $table->softDeletes();


        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('favorites');
    }
}
